import { http } from "@/utils/http";
import { sysApi } from '@/config/env'


// export const useCaptchaApi = () => {
// 	return service.get(`/${sysApi}/sys/auth/captcha`)
// }

export type RefreshCaptchaResult = {
  success: boolean;
  data: {
    /** `是否有验证码` */
    enabled: boolean;
    /** 验证码图片 */
    image: string;
    /** key */
    key: string;
  };
};


/** 验证码 */
export const useCaptchaApi = () => {
  return http.request<RefreshCaptchaResult>("get", sysApi + "/sys/auth/captcha");
};


// export const useSendCodeApi = (mobile: string) => {
// 	return service.post(`/${sysApi}/sys/auth/send/code?mobile=` + mobile)
// }

// export const useAccountLoginApi = (data: any) => {
// 	return service.post(`/${sysApi}/sys/auth/login`, data)
// }

// export const useMobileLoginApi = (data: any) => {
// 	return service.post(`/${sysApi}/sys/auth/mobile`, data)
// }

// export const useLogoutApi = () => {
// 	return service.post(`/${sysApi}/sys/auth/logout`)
// }
